/**
 * 
 */
package uit.comstore.model.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author XIII
 *
 */
@Entity
@Table(name="ProductsImages")
@SuppressWarnings("serial")
public class ProductImage implements Serializable {

	private Long id;
	private String image;
	private Integer defaultFlag;
	private Date dateAdded;
	
	private Product product;

	@Id
	@GeneratedValue
	@Column(name="ProductsImagesId")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="Image")
	public String getImage() {
		return image;
	}
	public void setImage(String image) {
		this.image = image;
	}

	@Column(name="DefaultFlag")
	public Integer getDefaultFlag() {
		return defaultFlag;
	}
	public void setDefaultFlag(Integer defaultFlag) {
		this.defaultFlag = defaultFlag;
	}

	@Column(name="DateAdded")
	public Date getDateAdded() {
		return dateAdded;
	}
	public void setDateAdded(Date dateAdded) {
		this.dateAdded = dateAdded;
	}

	@OneToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="ProductsId", referencedColumnName="ProductsId")
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
}
